import { importAll } from '@utils/import-all'
import Generator from './generator'

const routeModules = importAll(
  require.context('./modules', false, /\.js$/)
)

const configs = {}
routeModules.forEach(({ camelModuleName, module }) => {
  configs[camelModuleName] = module
})

export default new Generator(configs).api
